#ifndef ProjectSandbox_H
#define ProjectSandbox_H

#include "SmallEngine.h"
#include "Sandbox.h"

#define MIN(x,y) ( (x)<(y) ? (x) : (y) )

class ProjectSandbox : public Sandbox
{
public:
    ProjectSandbox(const std::string &name = "Sandbox", CC::Scene* scene = nullptr);
	virtual ~ProjectSandbox();

	virtual void OnAttach() override;
	virtual void OnDetach() override;

    virtual void OnUpdate(CC::Timestep ts, std::string renderscene = "") override;

    virtual void OnImGuiRender() override;
    
protected:
    virtual void OnKeyReleased(CC::KeyReleasedEvent &e);
    virtual void OnKeyWinPressed(CC::KeyWinEvent &e);
    virtual void HandleLeftButtonPressed();
    virtual void HandleLeftButtonMoved(float deltaX, float deltaY);
    virtual void HandleLeftButtonReleased();

    virtual void HandleMidButtonPressed();
    virtual void HandleMidButtonMoved(float deltaX, float deltaY);
    virtual void HandleMidButtonReleased();

    virtual void OnMouseScrolled(CC::MouseScrolledEvent &e);

private:
	glm::vec4 m_ClearColor = {0.0f, 0.0f, 0.0f, 0.0f};

private:   

    CC::Entity* m_current = nullptr;

    bool m_ButtonLeftPressed = false;
    bool m_ButtonRightPressed = false;
    bool m_ButtonMidPressed = false;

    CC::Entity* m_node;
    CC::Entity* nodebtn;
};

#endif